package com.yykj.message.center.client.feign;

import com.tencentcloudapi.sms.v20210111.models.SendStatus;
import com.yykj.common.vo.ResultVO;
import com.yykj.message.center.client.dto.DrugOrderMessageBodyDTO;
import com.yykj.message.center.client.dto.MessageDTO;
import com.yykj.message.center.client.dto.PrescriptionMessageBodyDTO;
import com.yykj.message.center.client.dto.TDMQMessageSendResult;
import com.yykj.message.center.client.enums.OrderType;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.pulsar.client.api.PulsarClientException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/10/25 12:56
 */
@FeignClient(name = "message-center-server")
public interface MessageFeignClient {

    @ApiOperation("获取验证码")
    @GetMapping("/api/message/getCode")
    ResultVO<MessageDTO> getCode(@RequestParam(name = "phoneNum") String phoneNum);

    @ApiOperation("发送支付成功消息")
    @PostMapping("/api/tdmq/message/pay/success")
    public TDMQMessageSendResult sendOrderPaySuccessMessage(@RequestParam(name = "orderId") String orderId,
                                                            @RequestParam(name = "orderType") OrderType orderType) throws PulsarClientException;

    @ApiOperation("发送订单结束消息")
    @PostMapping("/api/tdmq/message/order/finish")
    public TDMQMessageSendResult sendOrderFinishMessage(@RequestParam(name = "orderId") String orderId,
                                                        @RequestParam(name = "orderType") OrderType orderType) throws PulsarClientException;

    @ApiModelProperty("发送处方消息--新建")
    @PostMapping("/api/tdmq/message/prescription/created")
    public TDMQMessageSendResult sendPrescriptionCreatedMessage(@RequestBody PrescriptionMessageBodyDTO messageBodyDTO) throws PulsarClientException;

    @ApiModelProperty("发送处方消息--状态变更")
    @PostMapping("/api/tdmq/message/prescription/change")
    public TDMQMessageSendResult sendPrescriptionChangeMessage(@RequestBody PrescriptionMessageBodyDTO messageBodyDTO) throws PulsarClientException;

    @ApiModelProperty("发送处方药品下单消息")
    @PostMapping("/api/tdmq/message/drug/order/created")
    public TDMQMessageSendResult sendDrugOrderMessage(@RequestBody DrugOrderMessageBodyDTO messageBodyDTO) throws PulsarClientException;


    @ApiOperation("给医生:患者支付成功")
    @GetMapping("/api/message/sms/doctor/paySuccess")
    SendStatus[] smsDoctorPaySuccess(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "consultationType") String consultationType, @RequestParam(name = "dateStr") String dateStr);

    @ApiOperation("给患者:患者支付成功")
    @GetMapping("/api/message/sms/patient/paySuccess")
    SendStatus[] smsPatientPaySuccess(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName, @RequestParam(name = "consultationType") String consultationType);

    @ApiIgnore
    @ApiOperation("给患者:医生已接诊")
    @GetMapping("/api/message/sms/patient/doctorReceive")
    SendStatus[] smsPatientDoctorReceive(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:问诊结束")
    @GetMapping("/api/message/sms/patient/consultationFinish")
    SendStatus[] smsPatientConsultationFinish(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:问诊退款")
    @GetMapping("/api/message/sms/patient/consultationRefund")
    SendStatus[] smsPatientConsultationRefund(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:电子处方开具成功")
    @GetMapping("/api/message/sms/patient/prescriptionSuccess")
    SendStatus[] smsPatientPrescriptionSuccess(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:电子处方到期即将到期前（1天）")
    @GetMapping("/api/message/sms/patient/prescriptionTimeout")
    SendStatus[] smsPatientPrescriptionTimeout(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:信息授权")
    @GetMapping("/api/message/sms/patient/grant")
    SendStatus[] smsPatientgGrant(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName);

    @ApiOperation("给患者:预约挂号成功")
    @GetMapping("/api/message/sms/patient/appointment")
    SendStatus[] smsPatientAppointment(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName, @RequestParam(name = "dateStr") String dateStr, @RequestParam(name = "appointmentType") String appointmentType);

    @ApiOperation("给患者:预约挂号取消")
    @GetMapping("/api/message/sms/patient/appointmentCancel")
    SendStatus[] smsPatientAppointmentCancel(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName, @RequestParam(name = "dateStr") String dateStr, @RequestParam(name = "appointmentType") String appointmentType);

    @ApiOperation("给患者:检查检验")
    @GetMapping("/api/message/sms/patient/examine")
    SendStatus[] smsPatientExamine(@RequestParam(name = "phoneNum") String phoneNum, @RequestParam(name = "doctorName") String doctorName, @RequestParam(name = "examineType") String examineType, @RequestParam(name = "examineType2") String examineType2);

}
